package org.ns.consume;

import org.ns.learn.rpc.client.RpcClient;
import org.ns.learn.rpc.client.RpcClientException;
import org.ns.learn.rpc.client.rpcinterface.RpcClientBeanProxyManage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class ClientStartup {

    @Bean
    RpcClient rpcClient() throws RpcClientException {
        // rpc 远程操作客户端
        return new RpcClient("127.0.0.1", 11111);
    }

    @Bean
    RpcClientBeanProxyManage rpcClientBeanProxyManage() throws RpcClientException {
        // rpc bean 代理， 参数接受远程操作客户端
        return new RpcClientBeanProxyManage(rpcClient());
    }

}
